/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NewJApplet.java
 *
 * Created on May 19, 2009, 10:16:07 PM
 */
package CCPVSimulationRootPanelPackage;

import RobertsCode.FileManager;
import RobertsCode.RunTimeSettings;
import java.awt.Dimension;
import javax.swing.JFrame;

/**
 *
 * @author Heather
 */
public class CCPVMainPanelTest extends javax.swing.JApplet
{

  public static void main(String[] args)
  {
    CCPVMainPanelTest test = new CCPVMainPanelTest();
    test.setSize(defaultAppSize);
    JFrame windowFrame = new JFrame();
    windowFrame.add(test.getContentPane());
    windowFrame.setSize(defaultAppSize);
    windowFrame.setPreferredSize(defaultAppSize);
    windowFrame.pack();
  }

  public CCPVMainPanelTest()
  {
    init();
  }

  /** Initializes the applet NewJApplet */
  public void init()
  {
    try
    {
      java.awt.EventQueue.invokeAndWait(new Runnable()
      {

        public void run()
        {
          initComponents();
          // COMMENT OUT IF WANT TO TEST ON REAL DATA
          String fileName = "C:/CCPV Data/format.txt";
          RunTimeSettings rt = FileManager.csvReader(fileName);
          ccpvMainPanel.setAllAscriptiveTrees(rt.ascriptive_names);

          ccpvMainPanel.setSize(defaultAppSize);
          ccpvMainPanel.setPreferredSize(defaultAppSize);
          System.out.println("main container size: " + ccpvMainContainer.getSize());

          ccpvMainPanelFrame.setLayout(null);
          ccpvMainPanelFrame.add(ccpvMainPanel);
          ccpvMainPanelFrame.setSize(defaultAppSize);
          ccpvMainPanelFrame.setPreferredSize(defaultAppSize);
          ccpvMainPanelFrame.setVisible(true);
          ccpvMainPanelFrame.pack();
          ccpvMainPanelFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


          //ccpvMainContainer.add(ccpvMainPanel);
          //ccpvMainPanel.setVisible(true);
        }
      });
    } catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }

  /** This method is called from within the init() method to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    ccpvMainContainer = new javax.swing.JPanel();

    getContentPane().setLayout(null);

    ccpvMainContainer.setMinimumSize(new java.awt.Dimension(800, 570));
    ccpvMainContainer.setLayout(null);
    getContentPane().add(ccpvMainContainer);
    ccpvMainContainer.setBounds(10, 10, 800, 570);
  }// </editor-fold>//GEN-END:initComponents
  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JPanel ccpvMainContainer;
  // End of variables declaration//GEN-END:variables

  // my variables
  private static CCPVSimulationRootPanel ccpvMainPanel = new CCPVSimulationRootPanel();
  private static Dimension defaultAppSize = new Dimension(1500, 900);
  JFrame ccpvMainPanelFrame = new JFrame();
}
